home *** CD-ROM | disk | FTP | other *** search
/ Komputer for Alle 1999 #5 / 1999 CD 5 (black).iso / Delphi3 / install / data.z / MEMO_TLB.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1997-08-05  |  3.7 KB  |  131 lines

  1. unit Memo_TLB;
  2.  
  3. { This file contains pascal declarations imported from a type library.
  4.   This file will be written during each import or refresh of the type
  5.   library editor.  Changes to this file will be discarded during the
  6.   refresh process. }
  7.  
  8. { Memo Editor Application }
  9. { Version 1.0 }
  10.  
  11. interface
  12.  
  13. uses Windows, ActiveX, Classes, Graphics, OleCtrls, StdVCL;
  14.  
  15. const
  16.   LIBID_Memo: TGUID = '{55E49D30-9FFE-11D0-8095-0020AF74DE39}';
  17.  
  18. const
  19.  
  20. { Component class GUIDs }
  21.   Class_MemoApp: TGUID = '{F7FF4880-200D-11CF-BD2F-0020AF0E5B81}';
  22.   Class_MemoDoc: TGUID = '{55E49D35-9FFE-11D0-8095-0020AF74DE39}';
  23.  
  24. type
  25.  
  26. { Forward declarations: Interfaces }
  27.   IMemoApp = interface;
  28.   IMemoAppDisp = dispinterface;
  29.   IMemoDoc = interface;
  30.   IMemoDocDisp = dispinterface;
  31.  
  32. { Forward declarations: CoClasses }
  33.   MemoApp = IMemoApp;
  34.   MemoDoc = IMemoDoc;
  35.  
  36. { Dispatch interface for MemoApp Object }
  37.  
  38.   IMemoApp = interface(IDispatch)
  39.     ['{55E49D31-9FFE-11D0-8095-0020AF74DE39}']
  40.     function NewMemo: OleVariant; safecall;
  41.     function OpenMemo(const FileName: WideString): OleVariant; safecall;
  42.     procedure TileWindows; safecall;
  43.     procedure CascadeWindows; safecall;
  44.     function Get_MemoCount: Integer; safecall;
  45.     function Get_Memos(Index: Integer): OleVariant; safecall;
  46.     property MemoCount: Integer read Get_MemoCount;
  47.     property Memos[Index: Integer]: OleVariant read Get_Memos;
  48.   end;
  49.  
  50. { DispInterface declaration for Dual Interface IMemoApp }
  51.  
  52.   IMemoAppDisp = dispinterface
  53.     ['{55E49D31-9FFE-11D0-8095-0020AF74DE39}']
  54.     function NewMemo: OleVariant; dispid 1;
  55.     function OpenMemo(const FileName: WideString): OleVariant; dispid 2;
  56.     procedure TileWindows; dispid 3;
  57.     procedure CascadeWindows; dispid 4;
  58.     property MemoCount: Integer readonly dispid 5;
  59.     property Memos[Index: Integer]: OleVariant readonly dispid 6;
  60.   end;
  61.  
  62. { Dispatch interface for MemoDoc Object }
  63.  
  64.   IMemoDoc = interface(IDispatch)
  65.     ['{55E49D34-9FFE-11D0-8095-0020AF74DE39}']
  66.     procedure Clear; safecall;
  67.     procedure Insert(const Text: WideString); safecall;
  68.     procedure Save; safecall;
  69.     procedure Close; safecall;
  70.     function Get_FileName: WideString; safecall;
  71.     procedure Set_FileName(const Value: WideString); safecall;
  72.     function Get_Modified: WordBool; safecall;
  73.     property FileName: WideString read Get_FileName write Set_FileName;
  74.     property Modified: WordBool read Get_Modified;
  75.   end;
  76.  
  77. { DispInterface declaration for Dual Interface IMemoDoc }
  78.  
  79.   IMemoDocDisp = dispinterface
  80.     ['{55E49D34-9FFE-11D0-8095-0020AF74DE39}']
  81.     procedure Clear; dispid 1;
  82.     procedure Insert(const Text: WideString); dispid 2;
  83.     procedure Save; dispid 3;
  84.     procedure Close; dispid 4;
  85.     property FileName: WideString dispid 5;
  86.     property Modified: WordBool readonly dispid 6;
  87.   end;
  88.  
  89. { MemoAppObject }
  90.  
  91.   CoMemoApp = class
  92.     class function Create: IMemoApp;
  93.     class function CreateRemote(const MachineName: string): IMemoApp;
  94.   end;
  95.  
  96. { MemoDocObject }
  97.  
  98.   CoMemoDoc = class
  99.     class function Create: IMemoDoc;
  100.     class function CreateRemote(const MachineName: string): IMemoDoc;
  101.   end;
  102.  
  103.  
  104.  
  105. implementation
  106.  
  107. uses ComObj;
  108.  
  109. class function CoMemoApp.Create: IMemoApp;
  110. begin
  111.   Result := CreateComObject(Class_MemoApp) as IMemoApp;
  112. end;
  113.  
  114. class function CoMemoApp.CreateRemote(const MachineName: string): IMemoApp;
  115. begin
  116.   Result := CreateRemoteComObject(MachineName, Class_MemoApp) as IMemoApp;
  117. end;
  118.  
  119. class function CoMemoDoc.Create: IMemoDoc;
  120. begin
  121.   Result := CreateComObject(Class_MemoDoc) as IMemoDoc;
  122. end;
  123.  
  124. class function CoMemoDoc.CreateRemote(const MachineName: string): IMemoDoc;
  125. begin
  126.   Result := CreateRemoteComObject(MachineName, Class_MemoDoc) as IMemoDoc;
  127. end;
  128.  
  129.  
  130. end.
  131.